package ru.spbau.database.group3.types;

import java.nio.ByteBuffer;

/**
 * @author: stas
 * @date: 2/4/13
 * @time: 1:55 PM
 */
public interface Type  {
    Object valueOf(String s);
    Object readValueFromByteBuffer(ByteBuffer byteBuffer, int position);
    int compareTo(Object a, Object b);
    int size();
    Types getTypeEnum();

    final static int INTEGER_SIZE = 4;
    final static int DOUBLE_SIZE = 8;
    final static int CHAR_SIZE = 2;

    void writeValueToByteBuffer(ByteBuffer data, Object keyValue);
}
